<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link href="/ajax/libs/datapicker/datepicker3.css" th:href="@{/ajax/libs/datapicker/datepicker3.css}" rel="stylesheet"/>
<style>
    .droppable-active{background-color:#ffe!important}.tools a{cursor:pointer;font-size:80%}.form-body .col-md-6,.form-body .col-md-12{min-height:400px}.draggable{cursor:move}
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <form id="searchForm">
        <div class="btn-group hidden-xs" id="toolbar1" role="group">
            <div class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">用户ID</button>
                    </div>
                    <input type="text" class="form-control" id="usId" placeholder="用户ID">
                </div>
            </div>
            <div class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">用户名</button>
                    </div>
                    <input type="text" class="form-control" id="usNickname" placeholder="用户名">
                </div>
            </div>
            <div class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">广告位ID</button>
                    </div>
                    <input type="text" class="form-control" id="arsMediationRit" placeholder="广告位ID">
                </div>
            </div>
            <div class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">聚合广告位</button>
                    </div>
                    <input type="text" class="form-control" id="arsPrimeRit" placeholder="聚合广告位">
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">广告金币</button>
                    </div>
                    <input style="width: 50%" type="number" id="startGoldCoin" class="form-control"
                           placeholder="start">
                    <input style="display:inline; width: 50%" id="endGoldCoin" type="number" class="form-control"
                           placeholder="end">
                </div>
            </div>

            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">广告渠道</button>
                    </div>
                    <select class="form-control input-s-sm inline" id="arsChannel"
                            th:with="type=${@dictService.selectDictData('ad_channel')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">渠道包</button>
                    </div>
                    <select class="form-control input-s-sm inline" id="uvChannel"
                            th:with="type=${@dictService.selectDictData('channel_package')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                </div>
            </div>
            <div style="margin-top: 10px" class="col-xs-3">
                <div class="input-group">
                    <div class="input-group-btn">
                        <button class="btn btn-white" type="button">广告位置</button>
                    </div>
                    <select th:if="${positionCode} == 'ad_reward_position'" class="form-control input-s-sm inline" id="arsPosition"
                            th:with="type=${@dictService.selectDictData('ad_reward_position')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                    <select th:if="${positionCode} == 'ad_banner_position'" class="form-control input-s-sm inline" id="arsPosition"
                            th:with="type=${@dictService.selectDictData('ad_banner_position')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                    <select th:if="${positionCode} == 'ad_splash_position'" class="form-control input-s-sm inline" id="arsPosition"
                            th:with="type=${@dictService.selectDictData('ad_splash_position')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                    <select th:if="${positionCode} == 'ad_interstitial_position'" class="form-control input-s-sm inline" id="arsPosition"
                            th:with="type=${@dictService.selectDictData('ad_interstitial_position')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                    <select th:if="${positionCode} == 'ad_interstitial_full_position'" class="form-control input-s-sm inline" id="arsPosition"
                            th:with="type=${@dictService.selectDictData('ad_interstitial_full_position')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                    <select th:if="${positionCode} == 'ad_native_position'" class="form-control input-s-sm inline" id="arsPosition"
                            th:with="type=${@dictService.selectDictData('ad_native_position')}">
                        <option value="">请选择</option>
                        <option th:each="e : ${type}" th:text="${e['dictLabel']}" th:value="${e['dictValue']}"></option>
                    </select>
                </div>
            </div>
            <div style="margin-top: 10px; margin-left: -16px; margin-right: 16px" class="col-xs-3">
                <!--            <label style="padding-top: 10px" class="col-sm-3 control-label">创建时间</label>-->
                <div class="col-sm-9" style="width: 108%">
                    <div class="form-group">
                        <div class="input-group date">
                            <span class="input-group-addon">创建时间</span>
                                <input id="createTime" type="text" class="form-control" value="">
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="btn-group hidden-xs" id="toolbar" role="group">
            <label id="arsRealityMoneySum" type="button" class="btn btn-outline btn-default">
                广告金币：0
            </label>
            <label style="margin-left: 10px" type="button" class="btn btn-primary" onclick="resetForm()" id=""><i
                    class="fa fa-paper-plane"></i>&nbsp;重置
            </label>
            <label style="margin-left: 10px" type="button" class="btn btn-primary" onclick="search()" id=""><i
                    class="fa fa-search"></i>&nbsp;搜索
            </label>
        </div>
    </form>
    <table class="bootstrap-table" data-mobile-responsive="true">
    </table>
</div>
<div th:include="include :: footer"></div>
<script src="/static/reasahi/js/ry-table.js?v=1.1.6" th:src="@{/reasahi/js/ry-table.js?v=1.1.6}"></script>
<script src="/js/jquery-ui-1.10..min.js" th:src="@{/js/jquery-ui-1.10.4.min.js}"></script>
<script src="/static/reasahi/js/moment.js?v1.1.6" th:src="@{/reasahi/js/moment.js?v=1.1.6}"></script>
<script src="/ajax/libs//datapicker/bootstrap-datepicker.js" th:src="@{/ajax/libs//datapicker/bootstrap-datepicker.js}"></script>
<script>
    var startCreatTime = moment().hours(0).minutes(0).seconds(0);
    $('#createTime').val(startCreatTime.format('YYYY-MM-DD'));
    $(document).ready(function(){setup_draggable();$("#n-columns").on("change",function(){var v=$(this).val();if(v==="1"){var $col=$(".form-body .col-md-12").toggle(true);$(".form-body .col-md-6 .draggable").each(function(i,el){$(this).remove().appendTo($col)});$(".form-body .col-md-6").toggle(false)}else{var $col=$(".form-body .col-md-6").toggle(true);$(".form-body .col-md-12 .draggable").each(function(i,el){$(this).remove().appendTo(i%2?$col[1]:$col[0])});$(".form-body .col-md-12").toggle(false)}});$("#copy-to-clipboard").on("click",function(){var $copy=$(".form-body").clone().appendTo(document.body);$copy.find(".tools, :hidden").remove();$.each(["draggable","droppable","sortable","dropped","ui-sortable","ui-draggable","ui-droppable","form-body"],function(i,c){$copy.find("."+c).removeClass(c).removeAttr("style")});var html=html_beautify($copy.html());$copy.remove();$modal=get_modal(html).modal("show");$modal.find(".btn").remove();$modal.find(".modal-title").html("复制HTML代码");$modal.find(":input:first").select().focus();return false})});var setup_draggable=function(){$(".draggable").draggable({appendTo:"body",helper:"clone"});$(".droppable").droppable({accept:".draggable",helper:"clone",hoverClass:"droppable-active",drop:function(event,ui){$(".empty-form").remove();var $orig=$(ui.draggable);if(!$(ui.draggable).hasClass("dropped")){var $el=$orig.clone().addClass("dropped").css({"position":"static","left":null,"right":null}).appendTo(this);var id=$orig.find(":input").attr("id");if(id){id=id.split("-").slice(0,-1).join("-")+"-"+(parseInt(id.split("-").slice(-1)[0])+1);$orig.find(":input").attr("id",id);$orig.find("label").attr("for",id)}$('<p class="tools col-sm-12 col-sm-offset-3">						<a class="edit-link">编辑HTML<a> | 						<a class="remove-link">移除</a></p>').appendTo($el)}else{if($(this)[0]!=$orig.parent()[0]){var $el=$orig.clone().css({"position":"static","left":null,"right":null}).appendTo(this);$orig.remove()}}}}).sortable()};var get_modal=function(content){var modal=$('<div class="modal" style="overflow: auto;" tabindex="-1">	<div class="modal-dialog"><div class="modal-content"><div class="modal-header"><a type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</a><h4 class="modal-title">编辑HTML</h4></div><div class="modal-body ui-front">	<textarea class="form-control" 	style="min-height: 200px; margin-bottom: 10px;font-family: Monaco, Fixed">'+content+'</textarea><button class="btn btn-success">更新HTML</button></div>				</div></div></div>').appendTo(document.body);return modal};$(document).on("click",".edit-link",function(ev){var $el=$(this).parent().parent();var $el_copy=$el.clone();var $edit_btn=$el_copy.find(".edit-link").parent().remove();var $modal=get_modal(html_beautify($el_copy.html())).modal("show");$modal.find(":input:first").focus();$modal.find(".btn-success").click(function(ev2){var html=$modal.find("textarea").val();if(!html){$el.remove()}else{$el.html(html);$edit_btn.appendTo($el)}$modal.modal("hide");return false})});$(document).on("click",".remove-link",function(ev){$(this).parent().parent().remove()});
    // $(document).ready(function(){$(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",})});
    $(".input-group.date").datepicker({todayBtn: "linked",keyboardNavigation: !1,forceParse: !1,calendarWeeks: !0,autoclose: !0});
</script>
<script>
    initUserId();
    function initUserId() {
        var userId = '[[${userId}]]';
        if (userId) {
            $("#usId").val(userId)
        }
    }
</script>
<script th:inline="javascript">
    var editFlag = [[${@permissionService.hasPermi('manage:adRecordSecondary:edit')}]];
    var removeFlag = [[${@permissionService.hasPermi('manage:adRecordSecondary:remove')}]];
    var arsPositionCode = [[${positionCode}]];
    // 假设您的select元素有一个id为'mySelect'
    var allOptions = $('#arsPosition').find('option');
    var allOptionsChannel = $('#uvChannel').find('option');
    function resetForm() {
        cmResetForm();
        var startCreatTime = moment().hours(0).minutes(0).seconds(0);
        $('#createTime').val(startCreatTime.format('YYYY-MM-DD'));
        search();
    }
</script>
<script src="/reasahi/manage/adRecordSecondary/adRecordSecondary.js"
        th:src="@{/reasahi/manage/adRecordSecondary/adRecordSecondary.js}"></script>
</body>
</html>